class FMULTIMAP{KTP,ETP} < $STR
****
A mapping from elements of type K to lists of elements of type T Unlike FMAP, this class is NOT meant to be used when void and must be created initially.
_
Implementation: Most of the primitive FMAP routines have been made private and renamed with a multi_ prefix. We do permit one operation that violates the interface, danger_multi_get which returns the actual flist associated with a particular key (not a copy of the flist). This list must *not* be modified and may well become invalid when other operations are performed upon the multi-map


Flattened version is here

Ancestors
$STR FMAP{_,_} AREF{_} COMPARE{_}



Public


Features
copy: SAME
create: SAME
**** Create must be called before use
delete(k: KTP, t: ETP): SAME
**** Delete an element "t" from the elements associated with k Do nothing if the target does not exist for "k"
delete_all(k: KTP): SAME
**** Delete all elements associated with element "k"
equals(b: $RO_MULTIMAP{KTP,ETP}): BOOL
**** Returns true if all of "e"'s elements are equal to self's elts Ordering is an issue. Should be redefined to be more precise for particular descendants
get_all(k: KTP): FLIST{ETP}
**** Return a copy of internal list associated with element "k"
has_pair(k:KTP,t:ETP): BOOL
insert(k: KTP, t: ETP): SAME
**** Insert a new element "t" associated with "k"
insert_pair(p: TUP{KTP,ETP}): SAME
n_targets(k: KTP): INT
**** Return the number of targets for the key "k"
n_targets: INT
**** Return the total number of targets
size: INT
**** Alias for n_targets to satisfy "CONTAINER{KTP}"
str: STR
**** Prints out a string version of the array of the components that are under $STR, and their associated indices

Iters
elt!: ETP
pair!: TUP{KTP, ETP}
**** Yields pairs of keys and elements - keys may repeat
target!(once k: KTP): ETP
**** Return the elements associated with k
target!: ETP
**** Return all the targets in the current multi-map


Private

double_size:SAME
**** A new table of twice the size of self with self's entries copied over.
elt_str(e: ETP): STR
halve_size:SAME
**** A new table of half the size of self with self's entries copied over.
ind_str(i: KTP): STR
const initially_provide_for: INT := 1;
multi_insert_pair(p:TUP{KTP,FLIST{ETP}}):SAME
attr total_n_targets: INT;
attr total_n_targets: INT;

The Sather Home Page